package com.xunfang.demo.service;

import com.xunfang.demo.dao.UserDao;
import com.xunfang.demo.dao.UserDaoImpl;
import com.xunfang.demo.entity.UserDemo;

import java.util.List;

public class UserServiceImpl implements UserService {

    UserDao userDao = new UserDaoImpl();

    @Override
    public boolean addUser(UserDemo userDemo) {
        return userDao.insertUser(userDemo) > 0 ? true : false;
    }

    @Override
    public boolean existsUsers(String username, String userpwd) {
        return userDao.selectBySome(username,userpwd)!=null ? true: false;
    }

    @Override
    public List<UserDemo> findUserAll() {
        return userDao.selectUserAll();
    }

    @Override
    public boolean removeUserById(Integer id) {
        return userDao.delUserById(id) > 0 ? true : false;
    }
}
